# Load Necessary Packages
library(estimatr)

# Load Datasets
setwd("/users/josephphillips/Dropbox/COVID-19/Data/FC Data Repository")
usa <- read.csv("USA.csv",header=T,sep=",")
uk <- read.csv("UK.csv",header=T,sep=",")
canada <- read.csv("Canada 1.csv",header=T,sep=",")
canada2 <- read.csv("Canada 2.csv",header=T,sep=",")

# Table C1
C1.m1 <- lm_robust(W2_target_false~factcheck_treatment,data=usa)
C1.m2 <- lm_robust(W2_target_false~factcheck_treatment+ideo7+health_trust+media_trust+target_false,data=usa)
C1.m3 <- lm_robust(W3_target_false~(factcheck_treatment*W3factcheck_treatment),data=usa)
C1.m4 <- lm_robust(W3_target_false~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+health_trust+media_trust+target_false,data=usa)
C1.m5 <- lm_robust(W4_target_false~(factcheck_treatment*W3factcheck_treatment),data=usa)
C1.m6 <- lm_robust(W4_target_false~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+crt+health_trust+media_trust+target_false,data=usa)

# Table C2
C2.m1 <- lm_robust(W2_targeted_false~factcheck_treatment,data=uk)
C2.m2 <- lm_robust(W2_targeted_false~factcheck_treatment+ideology1+knowledge+trust_healthgov+targeted_false,data=uk)
C2.m3 <- lm_robust(W3_targeted_false~(factcheck_treatment*W3factcheck_treatment),data=uk)
C2.m4 <- lm_robust(W3_targeted_false~(factcheck_treatment*W3factcheck_treatment)+ideology1+knowledge+trust_healthgov+targeted_false,data=uk)

# Table C3
C3.m1 <- lm_robust(targeted_false~treat,data=canada)
C3.m2 <- lm_robust(targeted_false~treat+university+age55+age65+male+frequentchurch+west+right+ideology1+knowledge+nonwhite+polinterest+trust_healthgov+total_media_trust,data=canada)

# Table C4
C4.m1 <- lm_robust(targeted_false~treat,data=canada2)
C4.m2 <- lm_robust(targeted_false~treat+age45+age55+age65+male+frequentchurch+left+right+ideology1+knowledge+nonwhite+polinterest+trust_healthgov,data=canada2)

# Table C5
C5.m1 <- lm_robust(W2_accuracy_con_theory1~factcheck_treatment+pid3+ideo7+health_trust+media_trust+accuracy_con_theory1,data=usa)
C5.m2 <- lm_robust(W2_accuracy_con_theory5~factcheck_treatment+health_trust+media_trust+accuracy_con_theory5,data=usa)
C5.m3 <- lm_robust(W2_accuracy_False1~factcheck_treatment+ideo7+lives_highincidence+crt+knowledge+accuracy_False1,data=usa)
C5.m4 <- lm_robust(W2_accuracy_False4~factcheck_treatment+ideo7+health_trust+media_trust+accuracy_False4,data=usa)

# Table C6
C6.m1 <- lm_robust(W2_accuracy_con_theory1~factcheck_treatment,data=usa)
C6.m2 <- lm_robust(W2_accuracy_con_theory5~factcheck_treatment,data=usa)
C6.m3 <- lm_robust(W2_accuracy_False1~factcheck_treatment,data=usa)
C6.m4 <- lm_robust(W2_accuracy_False4~factcheck_treatment,data=usa)

# Table C7
C7.m1 <- lm_robust(W3_accuracy_con_theory1~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+knowledge+health_trust+media_trust+accuracy_con_theory1,data=usa)
C7.m2 <- lm_robust(W3_accuracy_con_theory5~(factcheck_treatment*W3factcheck_treatment)+ideo7+knowledge+health_trust+media_trust+accuracy_con_theory5,data=usa)
C7.m3 <- lm_robust(W3_accuracy_False1~(factcheck_treatment*W3factcheck_treatment)+ideo7+crt+knowledge+health_trust+accuracy_False1,data=usa)
C7.m4 <- lm_robust(W3_accuracy_False4~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+health_trust+media_trust+accuracy_False4,data=usa)

# Table C8
C8.m1 <- lm_robust(W3_accuracy_con_theory1~(factcheck_treatment*W3factcheck_treatment),data=usa)
C8.m2 <- lm_robust(W3_accuracy_con_theory5~(factcheck_treatment*W3factcheck_treatment),data=usa)
C8.m3 <- lm_robust(W3_accuracy_False1~(factcheck_treatment*W3factcheck_treatment),data=usa)
C8.m4 <- lm_robust(W3_accuracy_False4~(factcheck_treatment*W3factcheck_treatment),data=usa)

# Table C9
C9.m1 <- lm_robust(W4_accuracy_con_theory1~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+knowledge+crt+health_trust+media_trust+accuracy_con_theory1,data=usa)
C9.m2 <- lm_robust(W4_accuracy_con_theory5~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+knowledge+health_trust+media_trust+accuracy_con_theory5,data=usa)
C9.m3 <- lm_robust(W4_accuracy_False1~(factcheck_treatment*W3factcheck_treatment)+ideo7+crt+knowledge+accuracy_False1,data=usa)
C9.m4 <- lm_robust(W4_accuracy_False4~(factcheck_treatment*W3factcheck_treatment)+pid3+ideo7+health_trust+media_trust+accuracy_False4,data=usa)

# Table C10
C10.m1 <- lm(W4_accuracy_con_theory1~(factcheck_treatment*W3factcheck_treatment),data=usa)
C10.m2 <- lm(W4_accuracy_con_theory5~(factcheck_treatment*W3factcheck_treatment),data=usa)
C10.m3 <- lm(W4_accuracy_False1~(factcheck_treatment*W3factcheck_treatment),data=usa)
C10.m4 <- lm(W4_accuracy_False4~(factcheck_treatment*W3factcheck_treatment),data=usa)

# Table C11
C11.m1 <- lm_robust(W2_accuracy_con_theory1~factcheck_treatment+trust_healthgov+accuracy_con_theory1,data=uk)
C11.m2 <- lm_robust(W2_accuracy_con_theory5~factcheck_treatment+ideology1+trust_healthgov+total_media_trust+accuracy_con_theory5,data=uk)
C11.m3 <- lm_robust(W2_accuracy_False1~factcheck_treatment+ideology1+trust_healthgov+accuracy_False1,data=uk)
C11.m4 <- lm_robust(W2_accuracy_False4~factcheck_treatment+ideology1+accuracy_False4,data=uk)

# Table C12
C12.m1 <- lm_robust(W2_accuracy_con_theory1~factcheck_treatment,data=uk)
C12.m2 <- lm_robust(W2_accuracy_con_theory5~factcheck_treatment,data=uk)
C12.m3 <- lm_robust(W2_accuracy_False1~factcheck_treatment,data=uk)
C12.m4 <- lm_robust(W2_accuracy_False4~factcheck_treatment,data=uk)

# Table C13
C13.m1 <- lm_robust(W3_accuracy_con_theory1~(factcheck_treatment*W3factcheck_treatment)+ideology1+trust_healthgov+accuracy_con_theory1,data=uk)
C13.m2 <- lm_robust(W3_accuracy_con_theory5~(factcheck_treatment*W3factcheck_treatment)+knowledge+trust_healthgov+accuracy_con_theory5,data=uk)
C13.m3 <- lm_robust(W3_accuracy_False1~(factcheck_treatment*W3factcheck_treatment)+accuracy_False1,data=uk)
C13.m4 <- lm_robust(W3_accuracy_False4~(factcheck_treatment*W3factcheck_treatment)+university+ideology1+knowledge+trust_healthgov+accuracy_False4,data=uk)

# Table C14
C14.m1 <- lm_robust(W3_accuracy_con_theory1~(factcheck_treatment*W3factcheck_treatment),data=uk)
C14.m2 <- lm_robust(W3_accuracy_con_theory5~(factcheck_treatment*W3factcheck_treatment),data=uk)
C14.m3 <- lm_robust(W3_accuracy_False1~(factcheck_treatment*W3factcheck_treatment),data=uk)
C14.m4 <- lm_robust(W3_accuracy_False4~(factcheck_treatment*W3factcheck_treatment),data=uk)

# Table C15
C15.m1 <- lm_robust(accuracy_con_theory1~treat+age65+frequentchurch+ideology1+nonwhite+trust_healthgov,data=canada)
C15.m2 <- lm_robust(accuracy_con_theory5~treat+age55+age65+frequentchurch+right+ideology1+knowledge+nonwhite+polinterest+trust_healthgov,data=canada)
C15.m3 <- lm_robust(accuracy_False1~treat+age55+age65+male+frequentchurch+west+ideology1+knowledge+nonwhite+trust_healthgov,data=canada)
C15.m4 <- lm_robust(accuracy_False4~treat+age55+age65+frequentchurch+quebec+ideology1+knowledge+nonwhite+trust_healthgov,data=canada)

# Table C16
C16.m1 <- lm_robust(accuracy_con_theory1~treat,data=canada)
C16.m2 <- lm_robust(accuracy_con_theory5~treat,data=canada)
C16.m3 <- lm_robust(accuracy_False1~treat,data=canada)
C16.m4 <- lm_robust(accuracy_False4~treat,data=canada)

# Table C17
C17.m1 <- lm(accuracy_con_theory1~treat+frequentchurch+ideology1+knowledge+trust_healthgov,data=canada2)
C17.m2 <- lm(accuracy_con_theory5~treat+age45+age55+frequentchurch+right+ideology1+knowledge+nonwhite+trust_healthgov,data=canada2)
C17.m3 <- lm(accuracy_False1~treat+age65+frequentchurch+ideology1+knowledge+nonwhite,data=canada2)
C17.m4 <- lm(accuracy_False4~treat+age65+frequentchurch+quebec+ideology1+knowledge+nonwhite+trust_healthgov+hotspot,data=canada2)

# Table C18
C18.m1 <- lm(accuracy_con_theory1~treat,data=canada2)
C18.m2 <- lm(accuracy_con_theory5~treat,data=canada2)
C18.m3 <- lm(accuracy_False1~treat,data=canada2)
C18.m4 <- lm(accuracy_False4~treat,data=canada2)
